From 8743fd3cb964ad35846e635191807b6388b6093e Mon Sep 17 00:00:00 2001 From: oliskoli Date: Thu, 24 Apr 2008 21:09:27 +0000 Subject: [PATCH] dg100: Speed is in kilometers per hour. Add patch from Eike and Mirko. --- dg-100.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dg-100.c b/dg-100.c index 6b6942506..051857858 100644 --- a/dg-100.c +++ b/dg-100.c @@ -246,7 +246,11 @@ process_gpsfile(gbuint8 data[], route_head *track) bintime = be_read32(data + i + 8); bindate = be_read32(data + i + 12); wpt->creation_time = bintime2utc(bindate, bintime); - wpt->speed = be_read32(data + i + 16) / 100.0; + /* The device presents the speed as a fixed-point number + * with a scaling factor of 100, in km/h. + * The waypoint struct wants the speed as a + * floating-point number, in m/s. */ + wpt->speed = KPH_TO_MPS(be_read32(data + i + 16) / 100.0); wpt->wpt_flags.speed = 1; } -- 2.30.2